package com.lmt_17;

import java.net.*;
import java.nio.charset.StandardCharsets;

public class UDPClient {
    public static void main(String[] args) throws Exception{
        DatagramSocket socket = new DatagramSocket();
        String str = "55555555555";

        // 创建数据包对象
        DatagramPacket datagramPacket = new DatagramPacket(str.getBytes("UTF-8")
                ,str.length()
                , InetAddress.getLocalHost()
                ,1234);
        socket.send(datagramPacket);
        System.out.println("客户端数据发送完毕");
        socket.close();
    }
}
